package com.costeaalex.blueserver.comm;

import javax.comm.CommPort;

import com.costeaalex.blueserver.setup.SetupServerApp;

public class COMPortClientFound extends Thread
	{
	
	private COMPortClientFinder cCFL;
	private SetupServerApp sSAL;
	private CommPort cPL;
	
	public COMPortClientFound(COMPortClientFinder cCF, SetupServerApp sSA)
		{
		cCFL=cCF;
		sSAL=sSA;
		}
	
	@Override
	public void run()
		{
		super.run();
		
		while(true)
			{
			if(cCFL.getPort()!=null)
				{
				cPL=cCFL.getPort();
				break;
				}
			}
		
		cCFL.destroy();
		sSAL.COMPortFound(cPL);
		}
	
	}
